package io.github.yotta.logger.core;


import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;

/**
 * @author yotta
 * @date 2023/3/26 17:49
 */
@ConfigurationProperties(prefix = "yotta.log")
@Data
public class LogProperties implements EnvironmentAware {

    private String application;

    @Override
    public void setEnvironment(Environment environment) {
        if (StringUtils.isEmpty(application)) {
            this.application = environment.getProperty("spring.application.name");
        }
    }
}
